# 0
# a+b,当a有add方法时,b的radd不被调用

# 1
# 当第一个对象没有运算方法时,调用反运算方法

# 2
#没错,就是调用super的各种方法
class MoreInt(int):
    @staticmethod
    def __new__(*args, **kwargs):
        return super().__new__(*args, **kwargs)


# 3


# 4
class Item:
    name = 'haha'


print(Item.name)

a1 = Item()
a1.name = 'kaka'

a2 = Item()
a2.name = 'cr'
print(a1.name)
print(a2.name)
print(Item.name)


# 5
# 静态方法是类的特殊方法

class Dog:

    @staticmethod#如此就是静态方法
    def static(*param):
        print(param)

    def nostatic(self):
        print('i am not static method')


# 动手吧
# 0
class Cat:
    def __init__(self, *param):
        if param:
            print('传入了%d个数,分别是:' % len(param), end='')
            for each in param:
                print(each, end=' ')
        else:
            print('毫无参数')
c = Cat()


class Word(str):

    def __eq__(self, *args, **kwargs):
        mylen = len(self)
        yourlen = 0
        for each in args:
            yourlen += len(each)

        for each in kwargs:
            yourlen += len(each)

        return mylen == yourlen

w1 = Word('hahahaha')
w2 = Word('haha4444')
print(w1==w2)